#include <iostream>
#include <fstream>
#include <random>
#include <vector>
#include "spline.h"
#include <cmath>
#include <math.h>
#include <iomanip>
#include <unistd.h>

using namespace std;


int main(int argc, char* argv[])
{
  double D0=1, D1=100;
  double slope=-1;
  double logN0=0, N0=1;
  long N=0;

  int c;
  opterr = 0;
  while ((c = getopt (argc, argv, "s:d:D:n:")) != -1)
    switch (c)
      {
      case 'D':
        D1 = atof(optarg);
        break;
      case 'd':
        D0 = atof(optarg);
        break;
      case 's':
        slope = atof(optarg);
        break;
      case 'n':
	N0=atof(optarg);
        if (N0>0) logN0=log10(N0);
        break;
      case '?':
        if (optopt == 'T')
          fprintf (stderr, "Option -%c requires an argument.\n", optopt);
        else if (optopt == 't')
          fprintf (stderr, "Option -%c requires an argument.\n", optopt);
        else
          fprintf (stderr,
                   "Unknown option character `\\x%x'.\n",
                   optopt);
        return 1;
      default:
        abort ();
      }

  double logD1 = log10(D1);
  double logN=log10(D0/D1)*slope+log10(N0);
  N = pow(10,logN);
  //cout << N << endl;
  //  double deltaLogD=log10(D0/D1)/N;
  for(long i=N0; i<=N; i++)
    {
      //      d=pow(10,log10(i)/slope + logD1);
      //      cout << d << " " << i << endl;
      double logd= (log10(i)-log10(N0))/slope + log10(D1);
      cout << pow(10,logd) << "\t" << i << endl;
    }

    
}
